package cn.tedu.oop2;

/**
 * @author: Dsi
 * @date: 2021/11/9 17:39
 * @description:该类用于体会多态如何统一调用标准
 */
public class TestFruit {
    public static void main(String[] args) {
        Fruit f=new Fruit();
        Apple a=new Apple();
        Banana b=new Banana();

       get(b);
    }
    public static void get(Fruit n){
        n.clena();
    }
}
class Fruit{
    public void clena(){
        System.out.println("父类普通1");
    }
}
class Apple extends Fruit{
    @Override
    public void clena() {
        System.out.println("子类Apple2");
    }
}
class Banana extends Fruit{
    @Override
    public void clena() {
        System.out.println("子类banana3");
    }
}